﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Includes;

namespace AsyncroneModule
{
    /// <summary>
    /// Provides neccessairy functions for persisting and retrieving patients and their data
    /// </summary>
    public interface IPersistAsync
    {

        /// <summary>
        /// Checks whether a patient with the given number exists
        /// </summary>
        /// <param name="tel"> Telephone number to check the system for </param>
        /// <returns> true if patient exists, false otherwise </returns>
        bool isPatient(String tel);

        /// <summary>
        /// Checks whether the submitted value is a resubmit, or a new submit
        /// </summary>
        /// <param name="tel"> Telephone number to check the system for </param>
        /// <param name="timeDif"> Time difference for it to be considered a resubmit </param>
        /// <returns> true if patient already submitted vitaldata during the last timeDif seconds, false otherwise </returns>
        bool isResubmit(String tel, int timeDif);

        /// <summary>
        /// Gets the Flags of the patient with the telephonenumber
        /// </summary>
        /// <param name="tel"> The telephonenumber of the patient </param>
        /// <returns> The Flags which belong to the telephonenumber </returns>
        Flags getFlags(String tel);

        /// <summary>
        /// Gets the VitalData of the patient with the telephonenumber
        /// </summary>
        /// <param name="tel"> The telephonenumber of the patient </param>
        /// <returns> VitalData which belong to the telephonenumber </returns>
        VitalData getVData(String tel);

        /// <summary>
        /// Gets the Name of the Patient
        /// </summary>
        /// <param name="tel"> The telephonenumber of the patient </param>
        /// <returns> The Name as String </returns>
        String getPatientName(String tel);

        /// <summary>
        /// Adds a log to the logs within the Persistence
        /// </summary>
        /// <param name="tel"> The telephonenumber of the patient the log belongs to </param>
        /// <param name="log"> The log that is to be added </param>
        /// <returns> The Nothingness of a Cookie of Void </returns>
        void addLog(String tel, String log);

        /// <summary>
        /// Sets the flags wich belong to the patient found throug the telephonenumber
        /// </summary>
        /// <param name="tel"> The telephonenumber of the patient </param>
        /// <param name="flags"> The status flags wich are to be set </param>
        /// <returns> The Nothingness of a Cookie of Void </returns>
        void setFlags(String tel, Flags flags);

        /// <summary>
        /// Adds the Vitals to the list of Vitals from the patient found through the telephonenumber
        /// </summary>
        /// <param name="tel"> The telephonenumber of the patient </param>
        /// <param name="vitals"> The Vitals which are to be added to the list in the Persistence </param>
        /// <returns> The Nothingness of a Cookie of Void </returns>
        void addVital(String tel, Vitals vitals);
    }
}
